<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Article extends Auth_Controller {

    public function __construct(){
        parent::__construct();
        $this->load->model('article_mdl');
    }

    public function index(){
        $this->load->library('pagination');

        $config['base_url'] = site_url('admini/order/index');
        $config['total_rows'] = $this->article_mdl->get_count();
        $config['per_page'] = 10;
        $config['page_query_string'] = TRUE;
        $config['first_link'] = '首页';
        $config['last_link'] = '尾页';
        $config['next_link'] = '下一页';
        $config['prev_link'] = '上一页';
        $config['anchor_class'] = 'current';

        //分页
        $this->pagination->initialize($config);
        $page = $this->pagination->create_links();

        $per_page = $this->input->get('per_page',TRUE);
        $this->db->limit($config['per_page'],intval($per_page));
        $list = $this->article_mdl->select();

        $data = [
            'page' => $page,
            'list' => $list
        ];
        $this->_view('admin/articl_index',$data);
    }

    /**
     * 创建文章
     */
    public function create(){
        
    }
    

}

/* End of file article.php */
/* Location: ./application/controllers/admini/article.php */